package com.jar.exercise.反射.ReflectionUtils使用;

import com.jar.exercise.反射.Student;
import org.apache.logging.log4j.util.Strings;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;

import java.lang.reflect.Method;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        // 获取所有方法的类对象(包含父类)
        Method[] allDeclaredMethods = ReflectionUtils.getAllDeclaredMethods(Student.class);
        System.out.println(Arrays.toString(allDeclaredMethods));
        // 获取自己类的所有方法的类对象
        Method[] declaredMethods = ReflectionUtils.getDeclaredMethods(Student.class);
        System.out.println(Arrays.toString(declaredMethods));
        ReflectionUtils.clearCache();
    }
}
